package thread.thread_04_20.test_interrupt;

/**
 * @author bruin_du
 * @description 中断的标志位
 * @date 2022/5/2 20:14
 **/
public class TestInterrupted {
    private static class MyRunnable implements Runnable {
        @Override
        public void run() {
            for (int i = 0; i < 10; i++) {
                System.out.println(Thread.interrupted());
            }
        }
    }
    public static void main(String[] args) throws InterruptedException {
        MyRunnable target = new MyRunnable();
        Thread thread = new Thread(target, "李四");
        thread.start();
        thread.interrupt();
    }
}
